<#include "/common/defaultEngine.html"/>
<@pageTheme mark="${config.optimize()?string('true', 'false')}">
<@header title="新增ERP人事还款流程" bodyClass="white-bg"  libs=["prism","bootstrapSelect","ueditor"]/>
<div class="wrapper wrapper-content ibox-content">
    <@form.form id="form-payback-add"  class="form-horizontal">
    <input name="id" value="${bpmErpPersonPayback.id}" type="hidden">
    <div class="form-group">
        <label class="col-sm-3 control-label"><@ctx.i18n text = "流水号" />：
        </label>
        <div class="col-sm-8"><input name="serialNumber" value="${bpmErpPersonPayback.serialNumber?default('')}" class="form-control" type="text"  readonly="true">
        </div>
    </div>
    <div class="form-group">        <label class="col-sm-3 control-label"><@ctx.i18n text = "申请人"/>：
    </label>
        <div class="col-sm-8"><input name="applyUsername" value="${bpmErpPersonPayback.applyUsername?default('')}" class="form-control" type="text" readonly="true" >
        </div>
    </div>
    <div class="form-group">        <label class="col-sm-3 control-label"><@ctx.i18n text = "受益人"/>：
    </label>
        <div class="col-sm-8"><input name="applyBeneficiaryUsername" value="${bpmErpPersonPayback.applyBeneficiaryUsername?default('')}" class="form-control" type="text"  readonly="true" >
        </div>
    </div>
    <div class="form-group">        <label class="col-sm-3 control-label"><@ctx.i18n text = "余额"/>：
    </label>
        <div class="col-sm-8"><input name="applyFinancialBankBalance" value="${bpmErpPersonPayback.applyFinancialBankBalance?default('')}" class="form-control" type="number"  readonly="true" >
        </div>
    </div>
    <div class="form-group">        <label class="col-sm-3 control-label"><@ctx.i18n text = "输入金额"/>：
    </label>
        <div class="col-sm-8"><input name="applyEnterAmount" value="${bpmErpPersonPayback.applyEnterAmount?default('')}" class="form-control" type="number"  readonly="true" >
        </div>
    </div>
    <div class="form-group">
        <label class="col-sm-3 control-label"><@ctx.i18n text = "选择还款方式"/>：</label>
        <div class="col-sm-8">
            <@form.select name="applyPaybackMethod" dictType="sys_erp_paybackmethod" value="${bpmErpPersonPayback.applyPaybackMethod?default('')}"  readOnly="true" />
        </div>
    </div>
    <div class="form-group bankClass">        <label class="col-sm-3 control-label"><@ctx.i18n text = "余额"/>：
    </label>
        <div class="col-sm-8"><input name="applyBankBalance" value="${bpmErpPersonPayback.applyBankBalance?default('')}" class="form-control" type="number"   readonly="true">
        </div>
    </div>
    <div class="form-group newMoneyClass">
        <label class="col-sm-3 control-label"><@ctx.i18n text = "付款方式"/>：</label>
        <div class="col-sm-8">
            <@form.select name="applyPaymentMethod" dictType="sys_crm_coll_paymethod" value="${bpmErpPersonPayback.applyPaymentMethod?default('')}"   readOnly="true" />
        </div>
    </div>
    <div class="form-group newMoneyClass">
        <label class="col-sm-3 control-label"><@ctx.i18n text = "交易日期"/>：</label>
        <div class="col-sm-8">
            <div class="input-group date">
                <span class="input-group-addon"><i class="fa fa-calendar"></i></span>
                <input class="form-control" name="applyTransactionDate"  data-type="date"   value="${(bpmErpPersonPayback.applyTransactionDate?string('yyyy-MM-dd'))!}" data-format="yyyy-MM-dd" type="text"  readonly="true" />
            </div>
        </div>
    </div>
    <div class="form-group newMoneyClass">        <label class="col-sm-3 control-label"><@ctx.i18n text = "付款人"/>：
    </label>
        <div class="col-sm-8"><input name="applyPayerName" value="${bpmErpPersonPayback.applyPayerName?default('')}" class="form-control" type="text"   readonly="true">
        </div>
    </div>
    <div class="form-group newMoneyClass">        <label class="col-sm-3 control-label"><@ctx.i18n text = "附件"/>：
    </label>
        <div class="col-sm-8">

            <div class="layui-upload">
                <div class="layui-upload-list layui-upList-minHeight uploadpadding">
                    <table class="layui-table">
                        <thead>
                        <tr>
                            <th>文件名</th>
                            <th>大小</th>
                            <th>状态</th>
                            <th>操作</th>
                        </tr>
                        </thead>
                        <tbody id="demojiazhaoList">
                        <tr id="upjiazhaoload"></tr>
                        <#list proof as item>
                        <tr id="upload${item_index}">
                            <td> ${item.fileName?default("")}</td>
                            <td> ${item.fileSize?default("")}</td>
                            <td>已上传</td>
                            <td>
                                <a class="btn btn-danger btn-sm" href="#" download="${item.url}"><i class="fa fa-download"></i></a>
                            </td>
                        </tr>
                        </#list>
                        </tbody>
                    </table>
                </div>
            </div>

        </div>
    </div>
    <div class="form-group newMoneyClass">
        <label class="col-sm-3 control-label"><@ctx.i18n text = "备注"/>：</label>
        <div class="col-sm-8">
            <textarea name="applyMemo" class="form-control"  readonly="true">${bpmErpPersonPayback.applyMemo?default("")}</textarea>
        </div>
    </div>

    <div class="form-group">
        <label class="col-sm-3 control-label"><@ctx.i18n text = "审核"/>：</label>
        <div class="col-sm-8">
            <@form.radio name="approvalReview" dictType="sys_crm_isOrNo" value="${bpmErpPersonPayback.approvalReview?default('')}"  readOnly="true" />
        </div>
    </div>
    <div class="form-group">
        <label class="col-sm-3 control-label"><@ctx.i18n text = "审核备注"/>：</label>
        <div class="col-sm-8">
            <textarea name="approvalMemo" class="form-control"  readonly="true">${bpmErpPersonPayback.approvalMemo?default("")}</textarea>
        </div>
    </div>

    <div class="form-group crossClass">        <label class="col-sm-3 control-label"><@ctx.i18n text = "收到金额"/>：
    </label>
        <div class="col-sm-8"><input name="approvalReceivedAmount" value="${bpmErpPersonPayback.approvalReceivedAmount?default('')}" class="form-control" type="text"  readonly="true" >
        </div>
    </div>
    <div class="form-group crossClass">        <label class="col-sm-3 control-label"><@ctx.i18n text = "附件"/>：
    </label>
        <div class="col-sm-8">

            <div class="layui-upload">
                <div class="layui-upload-list layui-upList-minHeight uploadpadding">
                    <table class="layui-table">
                        <thead>
                        <tr>
                            <th>文件名</th>
                            <th>大小</th>
                            <th>状态</th>
                            <th>操作</th>
                        </tr>
                        </thead>
                        <tbody id="demojiazhaoList1">
                        <tr id="upjiazhaoload1"></tr>
                        <#list proofList as item>
                        <tr id="upload${item_index}1">
                            <td> ${item.fileName?default("")}</td>
                            <td> ${item.fileSize?default("")}</td>
                            <td>已上传</td>
                            <td>
                                <a class="btn btn-danger btn-sm" href="#" download="${item.url}"><i class="fa fa-download"></i></a>
                            </td>
                        </tr>
                        </#list>
                        </tbody>
                    </table>
                </div>
            </div>

        </div>
    </div>
    <div class="form-group crossClass">        <label class="col-sm-3 control-label"><@ctx.i18n text = "收据编号"/>：
    </label>
        <div class="col-sm-8"><input name="approvalReceiptno" value="${bpmErpPersonPayback.approvalReceiptno?default('')}" class="form-control" type="text"  readonly="true" >
        </div>
    </div>
    <div class="form-group">
        <label class="col-sm-3 control-label"><@ctx.i18n text = "财务经理审批"/>：</label>
        <div class="col-sm-8">
            <@form.radio name="managerApproval" dictType="sys_crm_isOrNo" value="${bpmErpPersonPayback.managerApproval?default('')}"  readOnly="true" />
        </div>
    </div>
    <div class="form-group">
        <label class="col-sm-3 control-label"><@ctx.i18n text = "财务经理备注"/>：</label>
        <div class="col-sm-8">
            <textarea name="managerApprovalRemark" class="form-control"  readonly="true">${bpmErpPersonPayback.managerApprovalRemark?default("")}</textarea>
        </div>
    </div>

    <div class="form-group">
        <label class="col-sm-3 control-label"><@ctx.i18n text = "财务经理通过审核时间"/>：</label>
        <div class="col-sm-8">
            <div class="input-group date">
                <span class="input-group-addon"><i class="fa fa-calendar"></i></span>
                <input class="form-control" name="managerApprovalCrossTime"  data-type="date" value="${(bpmErpPersonPayback.managerApprovalCrossTime?string('yyyy-MM-dd HH:mm:ss'))!}" type="text"  readonly="true" />
            </div>
        </div>
    </div>
</@form.form>
</div>
<@footer>
<script type="text/javascript">
    $(function(){
        var applyPaybackMethodValue=$("[name='applyPaybackMethod']").val();
        if(applyPaybackMethodValue=="1"||applyPaybackMethodValue=="2"){
            $(".bankClass").show();
            $(".newMoneyClass").hide();
        }
        else if(applyPaybackMethodValue=="3"){
            $(".bankClass").hide();
            $(".newMoneyClass").show();
        }
        else {
            $(".bankClass").hide();
            $(".newMoneyClass").hide();
        }
        var approvalReviewValue=$("[name='approvalReview']")[0].checked;
        if(approvalReviewValue){
            $(".crossClass").show();
        }
        else{
            $(".crossClass").hide();
        }
    })
    var prefix = baseURL + "erp/payback"
    $("#form-payback-add").validate({
        focusCleanup: true
    });

    function submitHandler() {
        if (opt.validate.form()) {
            opt.operate.save(prefix + "/add", $('#form-payback-add').serialize());
        }
    }
</script>
</@footer>
</@pageTheme>